import request from "@/utils/request"

interface Page {
	pageCode?: number,
	pageSize?: number
}
// 首页数据列表
export function fetchList(params?: Page) {
	return request({
		url: '/api/list',
		method: 'get',
		params
	})
}

interface DataListDetail {
	id: string
}

// 列表详情接口
export function fetchListDetail(data: DataListDetail) {
	return request({
		url: '/api/list/detail', 
		method: 'post',
		data
	})
}

interface LoginData {
	user: string
	pwd: string
}

// 登录接口
export function login(data: LoginData) {
	return request({
		url: '/api/login',
		method: 'post',
		data
	})
}

// 选车列表数据请求
export function fetchCar() {
	return request({
		url: '/dcd/v1/brand/?device_id=0',
		method: 'get',
	})
}

interface ParamsCarDetail {
	brand_id: string
	device_id: string
	city_name: string
}

// 选车详情接口
export function fetchCarDetail(params: ParamsCarDetail) {
	return request({
		url: '/dcd/v5/brand_series_list/',
		method: 'get',
		params
	})	
}


